<?php
/*
 * @Author: sunkaiyuan sunkaiyuan@namenode.com
 * @Date: 2022-10-10 15:16:06
 * @LastEditors: sunkaiyuan sunkaiyuan@namenode.com
 * @LastEditTime: 2023-01-04 16:15:28
 * @Description: 
 */

namespace App\Providers;

use App\Models\TemporaryToken;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Validator;

class ValidatorServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function boot()
    {
        
        Validator::extend('mobile', function ($attribute, $value, $parameters) {
            return preg_match("/^1[34578]{1}\d{9}$/", $value);
        });
        Validator::extend('not_just_num', function ($attribute, $value, $parameters) {
            return !preg_match("/^[0-9]*$/", $value);
        });
 
    }
    public function register()
    {
        //
    }
}